home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 23 / Amiga Format AFCD23 (Feb 1998, Issue 107).iso / +look_here_1st!+ / reader_requests / alienbreed3d2 / cheesesauce / streplayv2.4.s < prev    next >
Text File  |  1997-11-28  |  8KB  |  422 lines

  1. ;-----------------------------------------------------------------------;
  2. ;            SOUNDTRACKER V2.4 REPLAYER            ;
  3. ;CONSISTS OF:                                ;
  4. ;ONE ST-REPLAY-ROUTINE                            ;
  5. ;    THIS PROGRAMM WAS FIXED ON 13/04/91 BY MR.BASE/FLASHING BYTES    ;
  6. ;              © 1991 BY FLASHING BYTES DEVELOPMENTS.        ;
  7. ;         THIS SOURCECODE IS ONLY FOR TFB-MEMBERS!        ;
  8. ;-----------------------------------------------------------------------;
  9.  
  10. ;-------------------------------NACHLADEN--------------------------------
  11.  
  12. ;-------------------------BEGINN DES PROGRAMMES--------------------------
  13.  
  14.  SECTION banana,CODE_C
  15.  
  16. start:    MOVEM.L    D0-D7/A0-A6,-(A7)
  17.     MOVE.B    #02,$BFE001
  18.     move.l     $6c,oldirq+2        ;IRQ starten (Level 3)
  19.     move.l     #newirq,$6c
  20.     jsr      mt_init
  21. Wait:    btst    #6,$bfe001
  22.     bne.s    Wait
  23.     jsr       mt_end
  24.     move.l     oldirq+2,$6c        ;Alten IRQ restaurieren
  25.     moveq      #0,d0
  26.     sub.l      a0,a0    
  27.     sub.l     a1,a1
  28.     MOVE.B    #00,$BFE001
  29.     MOVEM.L    (A7)+,D0-D7/A0-A6
  30.     rts
  31.  
  32. ;-------------------------------EIGENER IRQ------------------------------
  33. newirq:    movem.l    d0-d7/a0-a6,-(sp)
  34.     jsr    mt_music
  35.     movem.l    (sp)+,d0-d7/a0-a6
  36. oldirq:    jmp     $0
  37.  
  38. ;--------------------------MUSIK INITIALISIEREN--------------------------
  39. mt_init:lea    MT_DATA,a0
  40.     add.l    #$03b8,a0
  41.     moveq    #$7f,d0
  42.     moveq    #0,d1
  43. mt_init1:
  44.     move.l    d1,d2
  45.     subq.w    #1,d0
  46. mt_init2:
  47.     move.b    (a0)+,d1
  48.     cmp.b    d2,d1
  49.     bgt.s    mt_init1
  50.     dbf    d0,mt_init2
  51.     addq.b    #1,d2
  52. mt_init3:
  53.     lea    MT_DATA,a0
  54.     lea    mt_sample1(pc),a1
  55.     asl.l    #8,d2
  56.     asl.l    #2,d2
  57.     add.l    #$438,d2
  58.     add.l    a0,d2
  59.     moveq    #$1e,d0
  60. mt_init4:
  61.     move.l    d2,(a1)+
  62.     moveq    #0,d1
  63.     move.w    42(a0),d1
  64.     asl.l    #1,d1
  65.     add.l    d1,d2
  66.     add.l    #$1e,a0
  67.     dbf    d0,mt_init4
  68.     lea    mt_sample1(PC),a0
  69.     moveq    #0,d0
  70. mt_clear:
  71.     move.l    (a0,d0.w),a1
  72.     clr.l    (a1)
  73.     addq.w    #4,d0
  74.     cmp.w    #$7c,d0
  75.     bne.s    mt_clear
  76.     clr.w    $dff0a8
  77.     clr.w    $dff0b8
  78.     clr.w    $dff0c8
  79.     clr.w    $dff0d8
  80.     clr.l    mt_partnrplay
  81.     clr.l    mt_partnote
  82.     clr.l    mt_partpoint
  83.     move.b    MT_DATA+$3b6,mt_maxpart+1
  84.     rts
  85.  
  86. ;----------------------------MUSIK AUSSCHLALTEN--------------------------
  87. mt_end:    clr.w    $dff0a8
  88.     clr.w    $dff0b8
  89.     clr.w    $dff0c8
  90.     clr.w    $dff0d8
  91.     move.w    #$f,$dff096
  92.     rts
  93.  
  94. ;------------------------------MUSIK ABSPIELEN---------------------------
  95. mt_music:
  96.     addq.w    #1,mt_counter
  97. mt_cool:cmp.w    #6,mt_counter
  98.     bne.s    mt_notsix
  99.     clr.w    mt_counter
  100.     bra    mt_rout2
  101. mt_notsix:
  102.     lea    mt_aud1temp(PC),a6
  103.     tst.b    3(a6)
  104.     beq.s    mt_arp1
  105.     lea    $dff0a0,a5        
  106.     bsr.s    mt_arprout
  107. mt_arp1:lea    mt_aud2temp(PC),a6
  108.     tst.b    3(a6)
  109.     beq.s    mt_arp2
  110.     lea    $dff0b0,a5
  111.     bsr.s    mt_arprout
  112. mt_arp2:lea    mt_aud3temp(PC),a6
  113.     tst.b    3(a6)
  114.     beq.s    mt_arp3
  115.     lea    $dff0c0,a5
  116.     bsr.s    mt_arprout
  117. mt_arp3:lea    mt_aud4temp(PC),a6
  118.     tst.b    3(a6)
  119.     beq.s    mt_arp4
  120.     lea    $dff0d0,a5
  121.     bra.s    mt_arprout
  122. mt_arp4:rts
  123. mt_arprout:
  124.     move.b    2(a6),d0
  125.     and.b    #$0f,d0
  126.     tst.b    d0
  127.     beq    mt_arpegrt
  128.     cmp.b    #$01,d0
  129.     beq.s    mt_portup
  130.     cmp.b    #$02,d0
  131.     beq.s    mt_portdwn
  132.     cmp.b    #$0a,d0
  133.     beq.s    mt_volslide
  134.     rts
  135. mt_portup:
  136.     moveq    #0,d0
  137.     move.b    3(a6),d0
  138.     sub.w    d0,22(a6)
  139.     cmp.w    #$71,22(a6)
  140.     bpl.s    mt_ok1
  141.     move.w    #$71,22(a6)
  142. mt_ok1:    move.w    22(a6),6(a5)
  143.     rts
  144. mt_portdwn:
  145.     moveq    #0,d0
  146.     move.b    3(a6),d0
  147.     add.w    d0,22(a6)
  148.     cmp.w    #$538,22(a6)
  149.     bmi.s    mt_ok2
  150.     move.w    #$538,22(a6)
  151. mt_ok2:    move.w    22(a6),6(a5)
  152.     rts
  153. mt_volslide:
  154.     moveq    #0,d0
  155.     move.b    3(a6),d0
  156.     lsr.b    #4,d0
  157.     tst.b    d0
  158.     beq.s    mt_voldwn
  159.     add.w    d0,18(a6)
  160.     cmp.w    #64,18(a6)
  161.     bmi.s    mt_ok3
  162.     move.w    #64,18(a6)
  163. mt_ok3:    move.w    18(a6),8(a5)
  164.     rts
  165. mt_voldwn:
  166.     moveq    #0,d0
  167.     move.b    3(a6),d0
  168.     and.b    #$0f,d0
  169.     sub.w    d0,18(a6)
  170.     bpl.s    mt_ok4
  171.     clr.w    18(a6)
  172. mt_ok4:    move.w    18(a6),8(a5)
  173.     rts
  174. mt_arpegrt:
  175.     move.w    mt_counter(PC),d0
  176.     cmp.w    #1,d0
  177.     beq.s    mt_loop2
  178.     cmp.w    #2,d0
  179.     beq.s    mt_loop3
  180.     cmp.w    #3,d0
  181.     beq.s    mt_loop4
  182.     cmp.w    #4,d0
  183.     beq.s    mt_loop2
  184.     cmp.w    #5,d0
  185.     beq.s    mt_loop3
  186.     rts
  187. mt_loop2:
  188.     moveq    #0,d0
  189.     move.b    3(a6),d0
  190.     lsr.b    #4,d0
  191.     bra.s    mt_cont
  192. mt_loop3:
  193.     moveq    #$00,d0
  194.     move.b    3(a6),d0
  195.     and.b    #$0f,d0
  196.     bra.s    mt_cont
  197. mt_loop4:
  198.     move.w    16(a6),d2
  199.     bra.s    mt_endpart
  200. mt_cont:
  201.     add.w    d0,d0
  202.     moveq    #0,d1
  203.     move.w    16(a6),d1
  204.     and.w    #$fff,d1
  205.     lea    mt_arpeggio(PC),a0
  206. mt_loop5:
  207.     move.w    (a0,d0),d2
  208.     cmp.w    (a0),d1
  209.     beq.s    mt_endpart
  210.     addq.l    #2,a0
  211.     bra.s    mt_loop5
  212. mt_endpart:
  213.     move.w    d2,6(a5)
  214.     rts
  215. mt_rout2:
  216.     lea    MT_DATA,a0
  217.     move.l    a0,a3
  218.     add.l    #$0c,a3
  219.     move.l    a0,a2
  220.     add.l    #$3b8,a2
  221.     add.l    #$43c,a0
  222.     move.l    mt_partnrplay(PC),d0
  223.     moveq    #0,d1
  224.     move.b    (a2,d0),d1
  225.     asl.l    #8,d1
  226.     asl.l    #2,d1
  227.     add.l    mt_partnote(PC),d1
  228.     move.l    d1,mt_partpoint
  229.     clr.w    mt_dmacon
  230.     lea    $dff0a0,a5
  231.     lea    mt_aud1temp(PC),a6
  232.     bsr    mt_playit
  233.     lea    $dff0b0,a5
  234.     lea    mt_aud2temp(PC),a6
  235.     bsr    mt_playit
  236.     lea    $dff0c0,a5
  237.     lea    mt_aud3temp(PC),a6
  238.     bsr    mt_playit
  239.     lea    $dff0d0,a5
  240.     lea    mt_aud4temp(PC),a6
  241.     bsr    mt_playit
  242.     move.w    #$01f4,d0
  243. mt_rls:    dbf    d0,mt_rls
  244.     move.w    #$8000,d0
  245.     or.w    mt_dmacon,d0
  246.     move.w    d0,$dff096
  247.     lea    mt_aud4temp(PC),a6
  248.     cmp.w    #1,14(a6)
  249.     bne.s    mt_voice3
  250.     move.l    10(a6),$dff0d0
  251.     move.w    #1,$dff0d4
  252. mt_voice3:
  253.     lea    mt_aud3temp(PC),a6
  254.     cmp.w    #1,14(a6)
  255.     bne.s    mt_voice2
  256.     move.l    10(a6),$dff0c0
  257.     move.w    #1,$dff0c4
  258. mt_voice2:
  259.     lea    mt_aud2temp(PC),a6
  260.     cmp.w    #1,14(a6)
  261.     bne.s    mt_voice1
  262.     move.l    10(a6),$dff0b0
  263.     move.w    #1,$dff0b4
  264. mt_voice1:
  265.     lea    mt_aud1temp(PC),a6
  266.     cmp.w    #1,14(a6)
  267.     bne.s    mt_voice0
  268.     move.l    10(a6),$dff0a0
  269.     move.w    #1,$dff0a4
  270. mt_voice0:
  271.     move.l    mt_partnote(PC),d0
  272.     add.l    #$10,d0
  273.     move.l    d0,mt_partnote
  274.     cmp.l    #$400,d0
  275.     bne.s    mt_stop
  276. mt_higher:
  277.     clr.l    mt_partnote
  278.     addq.l    #1,mt_partnrplay
  279.     moveq    #0,d0
  280.     move.w    mt_maxpart(PC),d0
  281.     move.l    mt_partnrplay(PC),d1
  282.     cmp.l    d0,d1
  283.     bne.s    mt_stop
  284.     clr.l    mt_partnrplay
  285. mt_stop:tst.w    mt_status
  286.     beq.s    mt_stop2
  287.     clr.w    mt_status
  288.     bra.s    mt_higher
  289. mt_stop2:
  290.     rts
  291. mt_playit:
  292.     move.l    (a0,d1.l),(a6)
  293.     addq.l    #4,d1
  294.     moveq    #0,d2
  295.     move.b    2(a6),d2
  296.     and.b    #$f0,d2
  297.     lsr.b    #4,d2
  298.     move.b    (a6),d0
  299.     and.b    #$f0,d0
  300.     or.b    d0,d2
  301.     tst.b    d2
  302.     beq.s    mt_nosamplechange
  303.     moveq    #0,d3
  304.     lea    mt_samples(PC),a1
  305.     move.l    d2,d4
  306.     asl.l    #2,d2
  307.     mulu    #$1e,d4
  308.     move.l    (a1,d2),4(a6)
  309.     move.w    (a3,d4.l),8(a6)
  310.     move.w    2(a3,d4.l),18(a6)
  311.     move.w    4(a3,d4.l),d3
  312.     tst.w    d3
  313.     beq.s    mt_displace
  314.     move.l    4(a6),d2
  315.     add.l    d3,d2
  316.     move.l    d2,4(a6)
  317.     move.l    d2,10(a6)
  318.     move.w    6(a3,d4.l),8(a6)
  319.     move.w    6(a3,d4.l),14(a6)
  320.     move.w    18(a6),8(a5)
  321.     bra.s    mt_nosamplechange
  322. mt_displace:
  323.     move.l    4(a6),d2
  324.     add.l    d3,d2
  325.     move.l    d2,10(a6)
  326.     move.w    6(a3,d4.l),14(a6)
  327.     move.w    18(a6),8(a5)
  328. mt_nosamplechange:
  329.     move.w    (a6),d0
  330.     and.w    #$fff,d0
  331.     tst.w    d0
  332.     beq.s    mt_retrout
  333.     move.w    (a6),16(a6)
  334.     move.w    20(a6),$dff096
  335.     move.l    4(a6),(a5)
  336.     move.w    8(a6),4(a5)
  337.     move.w    (a6),d0
  338.     and.w    #$fff,d0
  339.     move.w    d0,6(a5)
  340.     move.w    20(a6),d0
  341.     or.w    d0,mt_dmacon
  342. mt_retrout:
  343.     tst.w    (a6)
  344.     beq.s    mt_nonewper
  345.     move.w    (a6),22(a6)
  346. mt_nonewper:
  347.     move.b    2(a6),d0
  348.     and.b    #$0f,d0
  349.     cmp.b    #$0b,d0
  350.     beq.s    mt_posjmp
  351.     cmp.b    #$0c,d0
  352.     beq.s    mt_setvol
  353.     cmp.b    #$0d,d0
  354.     beq.s    mt_break
  355.     cmp.b    #$0e,d0
  356.     beq.s    mt_setfil
  357.     cmp.b    #$0f,d0
  358.     beq.s    mt_setspeed
  359.     rts
  360. mt_posjmp:
  361.     not.w    mt_status
  362.     moveq    #0,d0
  363.     move.b    3(a6),d0
  364.     subq.b    #1,d0
  365.     move.l    d0,mt_partnrplay
  366.     rts
  367. mt_setvol:
  368.     move.b    3(a6),8(a5)
  369.     rts
  370. mt_break:
  371.     not.w    mt_status
  372.     rts
  373. mt_setfil:
  374.     moveq    #0,d0
  375.     move.b    3(a6),d0
  376.     and.b    #1,d0
  377.     rol.b    #1,d0
  378.     and.b    #$fd,$bfe001
  379.     or.b    d0,$bfe001
  380.     rts
  381. mt_setspeed:
  382.     move.b    3(a6),d0
  383.     and.b    #$0f,d0
  384.     beq.s    mt_back
  385.     clr.w    mt_counter
  386.     move.b    d0,mt_cool+3
  387. mt_back:rts
  388.  
  389. mt_aud1temp:
  390.     dcb.w    10,0
  391.     dc.w    1
  392.     dcb.w    2,0
  393. mt_aud2temp:
  394.     dcb.w    10,0
  395.     dc.w    2
  396.     dcb.w    2,0
  397. mt_aud3temp:
  398.     dcb.w    10,0
  399.     dc.w    4
  400.     dcb.w    2,0
  401. mt_aud4temp:
  402.     dcb.w    10,0
  403.     dc.w    8
  404.     dcb.w    2,0
  405. mt_partnote:    dc.l    0
  406. mt_partnrplay:    dc.l    0
  407. mt_counter:    dc.w    0
  408. mt_partpoint:    dc.l    0
  409. mt_samples:    dc.l    0
  410. mt_sample1:    dcb.l    31,0
  411. mt_maxpart:    dc.w    0
  412. mt_dmacon:    dc.w    0
  413. mt_status:    dc.w    0
  414. mt_arpeggio:
  415.     dc.w $0358,$0328,$02fa,$02d0,$02a6,$0280,$025c
  416.     dc.w $023a,$021a,$01fc,$01e0,$01c5,$01ac,$0194,$017d
  417.     dc.w $0168,$0153,$0140,$012e,$011d,$010d,$00fe,$00f0
  418.     dc.w $00e2,$00d6,$00ca,$00be,$00b4,$00aa,$00a0,$0097
  419.     dc.w $008f,$0087,$007f,$0078,$0071,$0000,$0000,$0000
  420.  
  421. MT_DATA: incbin "work:andy's_tunes/twochantrack"
  422.